﻿namespace NMA.Domain.Shared.Specification
{

    public class AndSpecification<T> : AbstractSpecification<T>
    {
        private readonly ISpecification<T> _left;
        private readonly ISpecification<T> _right;

        public AndSpecification(ISpecification<T> left, ISpecification<T> right)
        {
            this._left = left;
            this._right = right;
        }

        public override bool IsSatisfiedBy(T t)
        {
            return _left.IsSatisfiedBy(t) && _right.IsSatisfiedBy(t);
        }
    }
}
